package main

import (
	"gateway/inits"
	user "gateway/kitex_gen/user/userservice"
	"log"
	"net"
	"os"

	"github.com/cloudwego/kitex/server"
)

func main() {
	path := "config"
	if len(os.Args) > 1 {
		path = os.Args[1]
	}
	inits.Init(path)
	addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:50053")
	svr := user.NewServer(new(UserServiceImpl), server.WithServiceAddr(addr))

	err := svr.Run()

	if err != nil {
		log.Println(err.Error())
	}
}
